feat: add pinocchio counter example with compressible PDA#21
feat: add pinocchio counter example with compressible PDA#21
Conversation
Minimal Pinocchio + Light Protocol counter program demonstrating rent-free compressible accounts without Anchor dependency. Two instructions: create_counter (PDA init + Light CPI registration) and increment (pure on-chain owner-gated mutation). Full lifecycle test covers create, increment, auto-compress, decompress, and post-decompression increment.
| "@lightprotocol/compressed-token": "file:../../light-protocol/js/compressed-token", | ||
| "@lightprotocol/stateless.js": "file:../../light-protocol/js/stateless.js", |
There was a problem hiding this comment.
🔴 Dependencies changed from published packages to local file paths, breaking builds for all other developers
The typescript-client/package.json replaces published beta registry packages with local file: paths pointing to ../../light-protocol/js/.... This is a developer-local change that was accidentally committed.
Root Cause and Impact
The original dependencies:
"@lightprotocol/compressed-token": "beta",
"@lightprotocol/stateless.js": "beta",were changed to:
"@lightprotocol/compressed-token": "file:../../light-protocol/js/compressed-token",
"@lightprotocol/stateless.js": "file:../../light-protocol/js/stateless.js",These file: paths reference a sibling light-protocol repository that only exists on the original developer's machine. Any other developer running npm install in typescript-client/ will get an error because ../../light-protocol/js/compressed-token does not exist on their filesystem. This effectively breaks the entire typescript-client package for everyone else.
| "@lightprotocol/compressed-token": "file:../../light-protocol/js/compressed-token", | |
| "@lightprotocol/stateless.js": "file:../../light-protocol/js/stateless.js", | |
| "@lightprotocol/compressed-token": "beta", | |
| "@lightprotocol/stateless.js": "beta", |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
pinocchio/counter/pinocchio/swap/exampleWhat's included
Program (14 files):
create_counterinstruction — creates counter PDA, registers with Light Protocol for compression viaprepare_compressed_account_on_init+ CPIincrementinstruction — pure on-chain owner-gated mutation, no Light CPI neededCounterStatestruct withCompressionInfo,owner,count(bytemuck zero-copy)#[derive(LightProgramPinocchio)]Tests:
CounterSdkimplementingLightProgramInterfacefor decompressionKey design decisions
CpiAccountsConfig::newTest plan
cargo check -p pinocchio-countercompilescargo check --tests -p pinocchio-countercompiles